home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Magnum One
/
Magnum One (Mid-American Digital) (Disc Manufacturing).iso
/
d12
/
asmwiz10.arc
/
EXAMPLE.ASM
< prev
next >
Wrap
Assembly Source File
|
1990-04-06
|
9KB
|
175 lines
comment #
+----------------------------------------------------------------------+
| |
| ASMWIZ Copyright (c) 1990 Thomas G. Hanlin III |
| |
| ASMWIZ Demo Program |
| |
| assembled with the excellent OPTASM by SLR |
| |
+----------------------------------------------------------------------+
#
Sseg segment byte stack 'prog' ; dummy stack segment
Sseg ends
Cseg segment byte public 'prog'
assume cs:Cseg, ds:Cseg, ss:Sseg
org 100h
extn MV_INIT, MV_LOCATE, MV_MODE, MV_POPUP, MV_STROUT
extn MV_HIDECURSOR, MV_STROUT, MV_INSLINE, MV_DELLINE
extn MV_INSCHR, MV_DELCHR, MV_COLOR
extn S0_LENGTH, MD_TICK
; MASM/TASM programs should say "EXTRN MV_INIT:NEAR, MV_LOCATE:NEAR" (etc)
; instead. The "EXTN" statement is an OPTASM abbreviation for all that.
MAIN proc far
call MV_INIT ; initialize display routines
mov al,3 ; mode 3: 80x25 color text
call MV_MODE ; set display mode
call MV_HIDECURSOR ; turn off the cursor
mov dx,0125h ; row 1, column 37
call MV_LOCATE ; set cursor location
lea dx,WelcomeMsg ; ptr to "Welcome"
call MV_STROUT ; display it
mov cx,8 ;
Welcome1: call MV_INSLINE ; scroll it down
push cx ;
mov cx,1 ;
call MD_TICK ; delay an 18th of a second
pop cx ;
loop Welcome1 ; ...nine times
mov dx,0B25h ; row 11, column 37
call MV_LOCATE ; set cursor location
lea dx,ToTheMsg ; ptr to "to the"
call MV_STROUT ; display it
mov dx,0D01h ; row 13, column 1
call MV_LOCATE ; set cursor location
lea dx,AsmMsg ; ptr to "ASM" <cr>
call MV_STROUT ; display it
mov cx,37 ;
Welcome2: call MV_INSCHR ; scroll it right
push cx ;
mov cx,1 ;
call MD_TICK ; delay an 18th of a second
pop cx ;
loop Welcome2 ; ...37 times
mov dx,0D4Dh ; row 13, column 73
call MV_LOCATE ;
lea dx,WizMsg ; ptr to "WIZ"
call MV_STROUT ; display it
mov dx,0D29h ; row 13, column 41
call MV_LOCATE ; set cursor location
mov cx,36 ;
Welcome3: call MV_DELCHR ; scroll it left
push cx ;
mov cx,1 ;
call MD_TICK ; delay an 18th of a second
pop cx ;
loop Welcome3 ; ...36 times
mov dx,1925h ; row 25, column 37
call MV_LOCATE ; set cursor location
lea dx,LibraryMsg ; ptr to "Library"
call MV_STROUT ; display it
mov dx,0E01h ; row 14, column 1
call MV_LOCATE ; set cursor location
mov cx,10 ;
Welcome4: call MV_DELLINE ; scroll it up
push cx ;
mov cx,1 ;
call MD_TICK ; delay an 18th of a second
pop cx ;
loop Welcome4 ; ...10 times
mov dx,0901h ; row 9, column 1
mov ax,4 ;
ScrollAll: mov cx,20 ; columns to scroll
LineLeft: call MV_LOCATE ; set cursor position
call MV_DELCHR ; scroll it left
loop LineLeft ; go for all columns
add dh,2 ; move to next line
dec ax ; done yet?
jnz ScrollAll ; no, go for next row
lea dx,ScrWindow ;
call MV_POPUP ; pop up intro window
lea si,WindowText ; pointer to window text
mov dx,word ptr ScrWindow
xchg dl,dh ;
add dx,0102h ; starting text position
ShowWindow: call MV_LOCATE ; set cursor position
call S0_LENGTH ; determine length of text
jcxz WaitOnKey ; if zero, go exit
xchg dx,si ;
call MV_STROUT ; display the text
xchg dx,si ;
add si,cx ; move to next text line
inc si ;
inc dh ; move to next screen line
jmp ShowWindow ; go for all text
WaitOnKey: mov dx,191Bh ; row 25, column 26
call MV_LOCATE ; set cursor location
mov al,70h ; inverse video
call MV_COLOR ;
lea dx,PressAnyMsg ; ptr to "Press any key..."
call MV_STROUT ; display it
mov al,07h ; normal video
call MV_COLOR ;
mov ah,7 ; get a key
int 21h ;
or al,al ; is it extended?
jnz Done ; no, continue
mov ah,7 ; get the rest of the key
int 21h ;
Done: mov ax,4C00h
int 21h ; exit program
MAIN endp
WelcomeMsg db "Welcome",0
ToTheMsg db "to the",0
AsmMsg db "ASM",13,0
WizMsg db "WIZ",0
LibraryMsg db "Library",0
PressAnyMsg db "Press any key to continue",0
ScrWindow db 3,40,24,80 ; window coordinates
db 1,7 ; frame type and color
dw offset ScrTitle ; pointer to title
ScrTitle db "The Assembly Wizard's Library",0 ; window title
WindowText db "Since you're evidently an assembly",0
db "language programmer and may be",0
db "considered reasonably sophisticated,",0
db "I'll skip the sales pitch here and",0
db "just list a few of the capabilities",0
db "of the ASMWIZ library:",0
db " ",0
db "DOS, BIOS, and machine-level display",0
db "Base conversions (integer and long)",0
db "Long integer math support",0
db "Delay and countdown services",0
db "Pseudo-random number generation",0
db "File matching, command-line parsing",0
db "Environment scanning",0
db "String functions",0
db "Mouse support and sound generation",0
db "Checksum and CRC calculation",0
db "International time and date support",0,0
Cseg ends
end MAIN